package com.halflife.framework.dto;


/**
 * Created by zhaoyf on 2018/2/12.
 */
public class Result<T> {
    private String status;
    private T entity;
    private String message;

    private int totalCount;
    public int totalPage;

    public Result(String status,String message){
        this.status = status;
        this.message = message;
    }
    public Result(String status,String message,T entity){
        this.status = status;
        this.message = message;
        this.entity = entity;
    }

    public  static <T> Result Ok(T t){
        return new Result("ok","",t);
    }
    public static Result Ok(){
        return new Result("ok","");
    }
    public static Result No(String message){
        return new Result("no",message);
    }
    public static Result Error(String message){
        return new Result("error",message);
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getEntity() {
        return entity;
    }

    public void setEntity(T entity) {
        this.entity = entity;
    }



    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }
}
